package com.zenchn.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.time.LocalDateTime;

@ApiModel(value="系统参数",description="系统参数对象")
public class TSysConfig implements Serializable {
    private static final long serialVersionUID = 2286248478264754489L;
    @ApiModelProperty(value="参数配置ID")
    private String configId;

    @ApiModelProperty(value="创建时间",hidden = true)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @NotEmpty(message = "参数名称不能为空")
    @ApiModelProperty(value="参数名称")
    private String configName;

    @NotEmpty(message = "参数编码不能为空")
    @ApiModelProperty(value="参数编码")
    private String configCode;

    @NotEmpty(message = "参数值不能为空")
    @ApiModelProperty(value="参数值")
    private String configValue;

    @NotEmpty(message = "参数值类型不能为空")
    private String valueStyle;

    @ApiModelProperty(value="是否必须",hidden = true)
    private Boolean isMust;

    @ApiModelProperty(value="备注")
    private String memo;

    public String getConfigId() {
        return configId;
    }

    public void setConfigId(String configId) {
        this.configId = configId == null ? null : configId.trim();
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getConfigName() {
        return configName;
    }

    public void setConfigName(String configName) {
        this.configName = configName == null ? null : configName.trim();
    }

    public String getConfigCode() {
        return configCode;
    }

    public void setConfigCode(String configCode) {
        this.configCode = configCode == null ? null : configCode.trim();
    }

    public String getConfigValue() {
        return configValue;
    }

    public void setConfigValue(String configValue) {
        this.configValue = configValue == null ? null : configValue.trim();
    }

    public String getValueStyle() {
        return valueStyle;
    }

    public void setValueStyle(String valueStyle) {
        this.valueStyle = valueStyle == null ? null : valueStyle.trim();
    }

    public Boolean getIsMust() {
        return isMust;
    }

    public void setIsMust(Boolean isMust) {
        this.isMust = isMust;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo == null ? null : memo.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", configId=").append(configId);
        sb.append(", createTime=").append(createTime);
        sb.append(", configName=").append(configName);
        sb.append(", configCode=").append(configCode);
        sb.append(", configValue=").append(configValue);
        sb.append(", valueStyle=").append(valueStyle);
        sb.append(", isMust=").append(isMust);
        sb.append(", memo=").append(memo);
        sb.append("]");
        return sb.toString();
    }
}